<template>
  <div>
    <headers :city="headerCity"></headers>
    <swiperArea :swiperList="swiperList"></swiperArea>
    <iconArea :iconList="iconList"></iconArea>
    <recommendArea :recommendList="recommendList"></recommendArea>
    <weekendArea :weekendList="weekendList"></weekendArea>
  </div>
</template>

<script>
import axios from "axios";
import headers from "./header/headerNav";
import swiperArea from "./swiper/swiper";
import iconArea from "./icon/icon";
import recommendArea from "./recommend/recommend";
import weekendArea from "./weekend/weekend";
export default {
  // 组件名称
  name: "demo", // 组件参数 接收来自父组件的数据
  props: [],
  components: {
    headers,
    swiperArea,
    iconArea,
    recommendArea,
    weekendArea
  },
  data() {
    return {
      headerCity: "",
      iconList: [],
      swiperList: [],
      recommendList: [],
      weekendList: []
    };
  },
  computed: {},
  watch: {},
  mounted() {
    this.getAllMsg();
  },
  methods: {
    getAllMsg() {
      axios.get("/static/mock/index.json").then(res => {
        this.headerCity = res.data.data.city;
        this.swiperList = res.data.data.swiperList;
        this.iconList = res.data.data.iconList;
        this.recommendList = res.data.data.recommendList;
        this.weekendList = res.data.data.weekendList;
        // console.log(res.data.data);
      });
    }
  },
  beforeCreate() {},
  created() {},
  beforeMount() {}
};
</script> 
<style scoped>
</style>
